<?php
	require_once("scripts/dbconnection.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
		<title>eLibrary Administration : Add Book</title>
		<link href="style/defaults.css" rel="stylesheet" type="text/css" media="all" />
		<link href="style/elements.css" rel="stylesheet" type="text/css" media="all" />
		<script src="js/book.js" type="text/javascript"></script>
	</head>
	<body>
		
		<div class="header">
			<h1><a href="index.php">eLibrary</a></h1>
			<h3>Administer your library.</h3>
		</div>
		
		<div class="container">
			<h2>Add a book.</h2>
			<form name="addForm" id="addForm" action="doAdd.php" method="POST" onsubmit="return checkAddBook()">
				<div class="column">
					<label for="titleBox">Title<input type="text" id="titleBox" name="titleBox" /><br /><br />
					<label for="authorBox">Author* <span id="authorspan" class="hidden">- Please select an Author</span></label><select id="authorBox" name="authorBox">
						<option value="selectauthor">Select an Author...</option>
						<?php
							$authors = mysql_query("SELECT AuthorName FROM AUTHOR");
							while ($iter = mysql_fetch_assoc($authors))
							{
								echo "<option value=\"" . $iter["AuthorName"] . "\">" . $iter["AuthorName"] . "</option>";
							}
						?>
					</select>
				</div>
				<div class="column">
					<label for="callNoBox">Call No<input type="text" id="callNoBox" name="callNoBox" /><br /><br />
					<label for="ISBNBox">ISBN<input type="text" id="ISBNBox" name="ISBNBox" />
				</div>
				<div class="column">
					<label for="publisherBox">Publisher<input type="text" id="publisherBox" name="publisherBox" /><br /><br />
					<label for="descBox">Description<input type="text" id="descBox" name="descBox" />
				</div>
					
				<div class="separator"></div>
				
				<div class="column">
					<p>* Is the Author you are after not listed here? Click <a href="author_add.php" alt="Add Author">here</a> to add it to our database, then come back to add your book.</p>
				</div>
				
				<div class="column"></div>
				
				<div class="column">
					<input type="submit" value="Add" />
				</div>
							
				<div class="clear"></div>
			</form>
		</div>
	</body>
</html>